﻿#region Using directives

#endregion

using ApplicationLibrary.SqlConnector;

namespace ApplicationLibrary.Preferences
{
    public partial class PreferenceForm : WinFormsUI.Docking.DockContent
    {
        #region Private

        private string formName = string.Empty;

        protected string ConnectionString { get; private set; }

        public ProviderType providerType { get; private set; }

        #endregion

        public PreferenceForm()
        {
            InitializeComponent();
        }

        public PreferenceForm(string formname)
        {
            ConnectionString = GlobalInfo.DBaseInfo.dbManager.DB_ConnectionString;
            this.providerType = GlobalInfo.DBaseInfo.dbManager.DB_Provider;
            formName = formname;
            InitializeComponent();
        }

        public void AddPanel(PreferencePanel prefPanel)
        {
            if (preferenceContainer1 != null)
                preferenceContainer1.AddPanel(prefPanel);
        }

        public void AddPanel(PreferencePanel[] prefPanel)
        {
            if (prefPanel == null)
                return;

            for (int t = 0; t < prefPanel.Length; t++)
                if (prefPanel[t] != null)
                    preferenceContainer1.AddPanel(prefPanel[t]);
        }

        public string SetStatus
        {
            set
            {
                tssStatus.Text = value;
            }
        }
    }
}